# coding: utf-8
from sqlalchemy import Column, Integer, String, orm

from apps.models.base import db

class Dance(db.Model):
    __tablename__ = 'dance'

    id = Column(Integer, primary_key=True, autoincrement=True)
    name = Column(String(20), nullable=False)
    type = Column(Integer, nullable=False, comment='1学生 2教师') # 1 学生 2 教师
    logo = Column(String(255))
    status = Column(Integer, nullable=False, default=1, comment='1未删除 0已删除')
    usable = Column(Integer, nullable=False, default=0, comment='1可用 0不可用')

    @orm.reconstructor
    def __init__(self):
        super().__init__()
        self.fields = ['id', 'name', 'type', 'logo']

    def keys(self):
        return self.fields
